package com.dmgis.qxfw.dataservice.businessservice.common.entity;


import com.dmgis.qxfw.dataservice.businessservice.common.util.DateTime;
import com.dmgis.qxfw.dataservice.businessservice.common.util.PagingModel;
import com.dmgis.qxfw.dataservice.businessservice.common.util.StringUtil;

import javax.servlet.http.HttpServletRequest;

/**
 * 灾害点分页查询参数
 */
public class ZhdPagingModel extends PagingModel {

    public ZhdPagingModel() {
    }

    /**
     * 根据请求参数参数初始化,这里增加用户权限判断，通过过滤
     *
     * @param request
     */
    public ZhdPagingModel(HttpServletRequest request) {
        String searchParams = request.getParameter("searchParams");
        String curPage = request.getParameter("curPage");
        String pageNum = request.getParameter("pageNum");
        String city = request.getParameter("city");
        String county = request.getParameter("county");
        String startDate = request.getParameter("startDate");
        String endDate = request.getParameter("endDate");
        String wybh = request.getParameter("wybh");
        String year = request.getParameter("year");
        String zhname = request.getParameter("zhname");
        String zhdType = request.getParameter("zhdType");
        String home = request.getParameter("home");
        String keyPoint = request.getParameter("keyPoint");
        String noKeyPoint = request.getParameter("noKeyPoint");
        String cxtypes = request.getParameter("cxtypes");
        String wxrkmin = request.getParameter("wxrkmin");
        String wxrkmax = request.getParameter("wxrkmax");
        String gmdj = request.getParameter("gmdj");
        String xqdj = request.getParameter("xqdj");
        String zqdj = request.getParameter("zqdj");
        String lon = request.getParameter("lon");
        String lat = request.getParameter("lat");
        //不为空时赋值
        if (!StringUtil.IsNullOrEmpty(curPage)) {
            setCurPage(Integer.parseInt(curPage));
        }
        if (!StringUtil.IsNullOrEmpty(pageNum)) {
            setPageNum(Integer.parseInt(pageNum));
        }
        if (!StringUtil.IsNullOrEmpty(city)) {
            setCity(city);
        }
        if (!StringUtil.IsNullOrEmpty(county)) {
            setCounty(county);
        }
        if (!StringUtil.IsNullOrEmpty(wybh)) {
            setWybh(wybh);
        }
        if (!StringUtil.IsNullOrEmpty(startDate)) {
            setStartDate(startDate);
        } else {
            setStartDate(DateTime.now().toDateString());
        }
        if (!StringUtil.IsNullOrEmpty(endDate)) {
            setEndDate(endDate);
        } else {
            setEndDate(DateTime.now().toDateString());
        }
        if (!StringUtil.IsNullOrEmpty(searchParams)) {
            setSearchParams(searchParams);
        }
        if (!StringUtil.IsNullOrEmpty(year)) {
            setYear(year);
        }
        if (!StringUtil.IsNullOrEmpty(zhname)) {
            setZhname(zhname);
        }
        if (!StringUtil.IsNullOrEmpty(zhdType)) {
            setZhdType(zhdType);
        }
        if (!StringUtil.IsNullOrEmpty(home)) {
            setHome(home);
        }
        if (!StringUtil.IsNullOrEmpty(keyPoint)) {
            setKeyPoint(keyPoint);
        }
        if (!StringUtil.IsNullOrEmpty(noKeyPoint)) {
            setNoKeyPoint(noKeyPoint);

        }
        setCxtypes(cxtypes);//选择

        if (!StringUtil.IsNullOrEmpty(wxrkmin)) {
            setWxrkmin(wxrkmin);
        }
        if (!StringUtil.IsNullOrEmpty(wxrkmax)) {
            setWxrkmax(wxrkmax);
        }
        if (!StringUtil.IsNullOrEmpty(gmdj)) {
            setGmdj(gmdj);
        }
        if (!StringUtil.IsNullOrEmpty(xqdj)) {
            setXqdj(xqdj);
        }
        if (!StringUtil.IsNullOrEmpty(zqdj)) {
            setZqdj(zqdj);
        }
        if (!StringUtil.IsNullOrEmpty(lon)) {
            setLon(Double.parseDouble(lon));
        }
        if (!StringUtil.IsNullOrEmpty(lat)) {
            setLat(Double.parseDouble(lat));
        }
    }

    /**
     * 唯一编号
     */
    private String wybh;
    /**
     * 年份
     */
    private String year;
    /**
     * 名称
     */
    private String zhname;
    /**
     * 灾害点类型
     */
    private String zhdType;
    /**
     * 市
     */
    private String city;
    /**
     * 县
     */
    private String county;
    /**
     * 乡
     */
    private String home;
    /**
     * 重点关注点
     */
    private String keyPoint;
    /**
     * 非重点关注所有点
     */
    private String noKeyPoint;
    /**
     * 统计类型 {"":调查点,"yhd":隐患点,"sbd":速报点}
     */
    private String cxtypes;

    /**
     * 开始时间
     */
    private String startDate;
    /**
     * 结束时间
     */
    private String endDate;
    /**
     * 最小威胁人口
     */
    private String wxrkmin;
    /**
     * 最大威胁人口
     */
    private String wxrkmax;
    /**
     * 规模等级
     */
    private String gmdj;
    /**
     * 险情等级
     */
    private String xqdj;
    /**
     * 灾情等级
     */
    private String zqdj;

    /**
     * 经度
     */
    private double lon;
    /**
     * 纬度
     */
    private double lat;

    public String getWybh() {
        return wybh;
    }

    public void setWybh(String wybh) {
        this.wybh = wybh;
    }

    public String getYear() {
        return year;
    }

    public void setYear(String year) {
        this.year = year;
    }

    public String getZhdType() {
        return zhdType;
    }

    public void setZhdType(String zhdType) {
        this.zhdType = zhdType;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getCounty() {
        return county;
    }

    public void setCounty(String county) {
        this.county = county;
    }

    public String getHome() {
        return home;
    }

    public void setHome(String home) {
        this.home = home;
    }

    public String getZhname() {
        return zhname;
    }

    public void setZhname(String zhname) {
        this.zhname = zhname;
    }

    public String getKeyPoint() {
        return keyPoint;
    }

    public void setKeyPoint(String keyPoint) {
        this.keyPoint = keyPoint;
    }

    public String getNoKeyPoint() {
        return noKeyPoint;
    }

    public void setNoKeyPoint(String noKeyPoint) {
        this.noKeyPoint = noKeyPoint;
    }

    public String getCxtypes() {
        return cxtypes;
    }

    public void setCxtypes(String cxtypes) {
        this.cxtypes = cxtypes;
    }

    public String getStartDate() {
        return startDate;
    }

    public void setStartDate(String startDate) {
        this.startDate = startDate;
    }

    public String getEndDate() {
        return endDate;
    }

    public void setEndDate(String endDate) {
        this.endDate = endDate;
    }

    public String getWxrkmin() {
        return wxrkmin;
    }

    public void setWxrkmin(String wxrkmin) {
        this.wxrkmin = wxrkmin;
    }

    public String getWxrkmax() {
        return wxrkmax;
    }

    public void setWxrkmax(String wxrkmax) {
        this.wxrkmax = wxrkmax;
    }

    public String getGmdj() {
        return gmdj;
    }

    public void setGmdj(String gmdj) {
        this.gmdj = gmdj;
    }

    public String getXqdj() {
        return xqdj;
    }

    public void setXqdj(String xqdj) {
        this.xqdj = xqdj;
    }

    public String getZqdj() {
        return zqdj;
    }

    public void setZqdj(String zqdj) {
        this.zqdj = zqdj;
    }

    public double getLon() {
        return lon;
    }

    public void setLon(double lon) {
        this.lon = lon;
    }

    public double getLat() {
        return lat;
    }

    public void setLat(double lat) {
        this.lat = lat;
    }
}
